package cn.tedu.boot01.mapper;

import cn.tedu.boot01.entity.Emp;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface EmpMapper {

    @Insert("INSERT INTO emp VALUES(NULL,#{name},#{salary},#{job})")
    void insert(Emp emp);

    @Select("SELECT * FROM emp")
    List<Emp> select();

    @Delete("DELETE FROM emp WHERE id=#{id}")
    void delete(int id);

    @Update("UPDATE emp SET name=#{name},salary=#{salary},job=#{job} WHERE id=#{id}")
    void update(Emp emp);
}
